e
#Title[ut̓͂v]
#Text[ׂځ[E؂'s
ut̓͂v ]
#BackGround[User]
#BGM[.\..\bgm\bgm.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	
	////////////////////////////////////////////////////////////////////////
	//                                                          //
	//   ȇxɂ                                       //
	////////////////////////////////////////////////////////////////////////
	
	@Initialize{
		InitializeData();
		
		LoadUserShotData(shot_ryoyan);
		
		SetLife(1000);
		SetDamageRate(15,0);
		SetInvincibility(120);
		SetCollisionEx(32,16);
		SetEnemyMarker(true);
		
		SetX( GetCenterX() );
		SetY( GetCenterY() - 100 );
		
		move02(GetCenterX(),GetCenterY()-100,120,0,0,0);
		
		TMain();
	}
	
	@MainLoop{
		yield;
	}
	
	@DrawLoop{
		DrawBoss(imgBoss);
	}
	
	@Finalize{
		FinalizeData();
	}
	
	task TMain(){
		wait(60);
		
		DeclareSpell();
		
		Atack();
		Move();
	}
	
	function DeclareSpell(){
		LastSpell();
		
		SetTimer(120);
		CutIn(YOUMU,"ut̓͂v",NULL,0,0,0,0);
		SetScore(1000000);
		wait(180);
	}
	
	task Atack(){
		loop{
			//ActPose02();
			//playSE(0);
			PlaySE(se_charge);
			sakurahubuki();
			wait(60);
			//ActPoseLILY01();
			let ang=rand(0,360);
			harudesuyo(ang);
			wait(60);
			harudesuyo(ang+180);
			wait(120);
		}
	}
	
	task harudesuyo(let ang){
		//playSE(3);
		ascent(ii in 1..6){
			ascent(i in 0..90){
				let spd=(1+absolute(9-i%18)/2);
				CreateShotA(0,GetX(),GetY(),10);
				SetShotDataA(0,0,1,ang+i*4,0,0.002*spd*ii,99,_PURPLE01L());
				SetShotDataA(0,60+spd*2,NULL,NULL,0,0.001*spd*ii,99,_PURPLE12());
				FireShot(0);
			}
		}
	}
	
	task sakurahubuki(){
		ascent(i in 0..400) {
			let len=sin(i*90/400)*500;
			let ang=i*222.5;
			let x=GetX()+cos(ang)*len;
			let y=GetY()+sin(ang)*len;
			CreateShot02(x,y,0,rand(30,-30),0.01,1.6,_RED01L(),30);
			CreateShot02(x,y,0,rand(150,210),0.01,1.6,_BLUE01L(),30);
			wait(i%6==5);
		}
	}
	
	task Move(){
	}
	
	#include_function ".\..\functions\initialize.txt"
	#include_function ".\..\functions\color_set.txt"
	#include_function ".\..\functions\function.txt"
}
